package geektime.spring.springbucks.controller;

import geektime.spring.springbucks.entity.Order;
import geektime.spring.springbucks.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Resource
    private OrderService service;

    @GetMapping("/list")
    public List<Order> list() {
        return service.list();
    }
}